package com.pactera.asmp.server.common.constants;

public enum ApplicationResponseTimeEnum {

    cold(1, "冷启动"), warm(2, "热启动");

    ApplicationResponseTimeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    private int code;

    private String description;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static String getDescription(int code) {
        for(ApplicationResponseTimeEnum value :ApplicationResponseTimeEnum.values()) {
            if(code == value.getCode()) {
                return value.getDescription();
            }
        }
        return null;
    }
}
